package service

import (
	"context"
	"gitee.com/jinmingzhi/cdce-service/internal/model"
	"gitee.com/jinmingzhi/cdce-service/internal/repository"
)

type Course interface {
	FindAll(ctx context.Context) ([]*model.Course, error)
}

type courseImpl struct {
	CourseRepo repository.Course
}

func NewCourse(course_repo repository.Course) Course {
	return &courseImpl{
		CourseRepo: course_repo,
	}
}

func (c *courseImpl) FindAll(ctx context.Context) ([]*model.Course, error) {
	return c.CourseRepo.FindAll(ctx)
}
